<?php

require_once __DIR__.'/includes.php';

class TestCase extends Illuminate\Foundation\Testing\TestCase {

    protected $show_sql_log = false;


	/**
	 * Creates the application.
	 *
	 * @return Symfony\Component\HttpKernel\HttpKernelInterface
	 */
	public function createApplication()
	{
		$unitTesting = true;

		$testEnvironment = 'testing';

		return require __DIR__.'/../../bootstrap/start.php';
	}

    protected function tearDown() {
    	if ($this->show_sql_log) {
	       	echo "\n----------------\n".$this->toString(). "\n";
	        foreach ( DB::getQueryLog() as $query ) {
	        	echo $query['query']. "\n";
	        }
	       	echo "\n";
    	}
    }

	public function testNotLoginRoot(){
		try {
			$crawler = $this->client->request('GET', '/');
			$this->assertFalse(true);
		} catch (Exception $e) {
			$this->assertTrue(true);
		}
	}

}
